/**
 * 
 */
package com.HibernateRecepies.DAO4_2;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;

import com.Hib.Util.SessionManager;
import com.HibernateRecepies.Domain4_2.Audio;

/**
 * @author Ignatiues charles arun
 * 
 *         Dec 10, 2010
 */
public class Dao4_2
	{

		private static SessionFactory sessionFactory;

		private static Session session;

		public static void main(String args[])
			{
				Audio adDsc = new Audio();
				adDsc.setDisc_id(new Long(10101));
				adDsc.setDisc_Name("Flag the wavin");
				adDsc.setNo_ofSongs(new Long(10));
				adDsc.setDisc_price(new Long(200));
				adDsc.setSinger("Carlos");

				sessionFactory = SessionManager.getSessionfactory();
				session = sessionFactory.getCurrentSession();
				Transaction tx = session.beginTransaction();
				session.save(adDsc);
				session.flush();
				tx.commit();

			}

	}
